/*
 * @FilePath: /cpp_study/ch05/forstr1.cpp
 * @Description: for循环访问字符串
 * @Author: dengrunting
 * @Date: 2022-01-07 18:36:38
 * @LastEditTime: 2022-01-07 18:37:39
 */

#include<iostream>
#include<string>
int main(){
    using namespace std;
    cout << "Enter a word: ";
    string word;
    cin >> word;

    for (int i = word.size() - 1; i >= 0; i--){
        cout << word[i];
    }
    cout << "\nBye.\n";
    return 0;
}